<!DOCTYPE html>
<html style="height: 100%">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width,initial-scale=1,user-scalable=0">
    <meta name="description" content="遇见与成长 - 图腾客户管理系统 - 实用工具">
    <title>C#{{cid}}的{{title}}</title>
    <meta http-equiv="Content-Security-Policy" content="upgrade-insecure-requests">
    <meta http-equiv="Access-Control-Allow-Origin" content="*">
    <link rel="stylesheet" href="/apps/css/bootstrap.min.css">
    <link rel="stylesheet" href="/apps/css/fontawesome-free-6.4.0-web/css/all.css">
    <link rel="stylesheet" href="/apps/css/mui.css">
    <style>
        .fa-stack-2x {
            color: #0f4c81;
        }
        .list-group-item {
            height: 100px;
            overflow: hidden;
        }
    </style>
</head>
<body>
    <header class="d-flex align-items-center bg-custom-color p-3">
        <button id="backButton" class="btn btn-primary rounded-circle me-3" style="background-color: white;" onclick="history.back();">
            <i class="fas fa-arrow-left custom-color"></i>
        </button>
        <span class="title-text text-white fs-5">C#{{cid}}的推广物料</span>
    </header>
    <div class="container">
        <div class="content">
            <div class="row mt-2">
                <div class="col">
                    <ul class="list-group mt-2">
                        {{#each materials}}
                        <li class="list-group-item list-group-item-action" onclick="window.location.href='{{this.link}}&cid={{@root.cid}}'">
                            <div class="d-flex w-100 justify-content-between">
                                <div>
                                    <h5 class="mb-1">{{this.name}}</h5>
                                    <small>{{this.description}}</small>
                                </div>
                            </div>
                        </li>
                        {{/each}}
                    </ul>
                </div>
            </div>
        </div>
        <nav aria-label="Page navigation" class="pagination-container">
            <button id="homeButton" class="btn btn-primary position-absolute top-0 start-0 m-3 rounded-circle" style="width: 50px; height: 50px; padding: 0;" onclick="window.location.href='https://totemlife.cn/apps/crm/';">
                <i class="fas fa-home" style="color:white;"></i>
            </button>
            <button id="formButton" class="btn btn-primary position-absolute top-0 end-0 m-3 rounded-circle" style="width: 50px; height: 50px; padding: 0;" onclick="searchInPage();">
                <i class="fas fa-search" style="color: white;"></i>
            </button>
            <ul class="pagination">
                {{{paginator}}}
            </ul>
        </nav>
    </div>
    <footer class="footer py-3 text-center">
        <span>我们为人类免疫事业而奉献</span>
        <br>
        <span>Copyright&copy;2023 图腾生命医学</span>
    </footer>
    <script src="https://res.wx.qq.com/open/js/jweixin-1.6.0.js"></script>
    <script src="/apps/js/bootstrap.bundle.min.js"></script>
    <script src="/apps/js/wx-client-dom.js"></script>
    <script>
        function searchInPage() {
            let searchText = window.prompt("请输入内容，匹配部分将被高亮显示", "");
            if (searchText && window.find && window.getSelection) {
                document.designMode = "on";
                var sel = window.getSelection();
                sel.collapse(document.body, 0);
                while (window.find(searchText)) {
                    document.execCommand("HiliteColor", false, "#88b04b"); // 高亮显示匹配项
                    sel.collapseToEnd();
                }
                document.designMode = "off";
            }
        }
    </script>
</body>
</html>
